<?php /* Smarty version 2.6.26, created on 2011-01-25 16:46:18
         compiled from admin/task-list.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'sslash', 'admin/task-list.html', 50, false),array('modifier', 'escape', 'admin/task-list.html', 50, false),array('modifier', 'date_format', 'admin/task-list.html', 119, false),)), $this); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" lang="ru" xml:lang="ru"> 
    <head>
	<title>LocalCRM</title>
	<script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>
	<script src="js/jquery-ui-1.8.4.custom.min.js" type="text/javascript"></script>
	<script src="js/jquery.blockUI.js" type="text/javascript"></script>
	<script src="js/jquery.contextMenu.js" type="text/javascript"></script>
	<script src="js/crm/common.js" type="text/javascript"></script>
	<link href="css/redmond/jquery-ui-1.8.4.custom.css" rel="stylesheet" type="text/css"/>
	<link href="css/jquery.contextMenu.css" rel="stylesheet" type="text/css"/>
    </head>
    <body>
	<script type="text/javascript">
	<?php echo '
	$(document).ready
	(
	    function()
	    {
		$(\'table#filters\')
		    .find(\'thead\')
			.css(\'cursor\',\'pointer\')
			.click
			(
			    function()
			    {
				$(this)
				    .parent()
				    .find(\'tbody\')
					.slideToggle();
			    }
			);
	    }
	);
	'; ?>

	</script>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/submodules/_menu.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

	<form method="get">
	<input type="hidden" name="do" value="filter"/>
	<table cellspacing="0" class="ui-widget ui-state-default" id="filters">
	    <thead class="ui-widget-header">
		<tr><th colspan="4">Блок фильтров</th></tr>
	    </thead>
	    <tbody class="ui-widget-content" <?php if ($_SESSION['filter']['task'] == ''): ?>style="display: none;"<?php endif; ?>>
		<tr>
		    <td align="right"><strong>Клиент:</strong></td>
		    <td colspan="3"><input type="text" name="customer_name" value="<?php echo ((is_array($_tmp=((is_array($_tmp=$_SESSION['filter']['task']['customer_name'])) ? $this->_run_mod_handler('sslash', true, $_tmp) : stripslashes($_tmp)))) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" style="width: 100%;"/></td>
		</tr>
		<tr>
		    <td align="right"><strong>Постановщик:</strong></td>
		    <td>
			<select name="cm_id">
			    <option value="">&mdash;</option>
			<?php $_from = $this->_tpl_vars['managers']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['manager']):
?>
			    <option value="<?php echo $this->_tpl_vars['manager']['id']; ?>
" <?php if ($_SESSION['filter']['task']['cm_id'] == $this->_tpl_vars['manager']['id']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['manager']['manager_name']; ?>
</option>
			<?php endforeach; endif; unset($_from); ?>
			</select>
		    </td>
		    <td align="right"><strong>Ответственный:</strong></td>
		    <td>
			<select name="rm_id">
			    <option value="">&mdash;</option>
			<?php $_from = $this->_tpl_vars['managers']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['manager']):
?>
			    <option value="<?php echo $this->_tpl_vars['manager']['id']; ?>
" <?php if ($_SESSION['filter']['task']['rm_id'] == $this->_tpl_vars['manager']['id']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['manager']['manager_name']; ?>
</option>
			<?php endforeach; endif; unset($_from); ?>
			</select>
		    </td>
		</tr>
		<tr>
		    <td align="right"><strong>Дата постановки:</strong></td>
		    <td>с <input type="text" name="task_startDate" class="date" value="<?php echo $_SESSION['filter']['task']['task_startDate']; ?>
"/> по <input type="text" name="task_stopDate" class="date" value="<?php echo $_SESSION['filter']['task']['task_stopDate']; ?>
"/></td>
		    <td align="right"><strong>Дата начала:</strong></td>
		    <td>с <input type="text" name="start_startDate" class="date" value="<?php echo $_SESSION['filter']['task']['start_startDate']; ?>
"/> по <input type="text" name="start_stopDate" class="date" value="<?php echo $_SESSION['filter']['task']['start_stopDate']; ?>
"/></td>
		</tr>
		<tr>
		    <td align="right">Отображать:</td>
		    <td colspan="3">
			<select name="display">
			    <option value="">Все</option>
			    <option value="opened" <?php if ($_SESSION['filter']['task']['display'] == 'opened'): ?>selected<?php endif; ?>>Открытые</option>
			    <option value="closed" <?php if ($_SESSION['filter']['task']['display'] == 'closed'): ?>selected<?php endif; ?>>Закрытые</option>
			</select>
		    </td>
		</tr>
		<tr><td colspan="4"><hr/></td></tr>
		<tr>
		    <td colspan="4" align="center">
			<input type="reset" class="button" value="Очистить фильтр"/>
			<input type="submit" class="button" value="Применить фильтр"/>
		    </td>
		</tr>
	    </tbody>
	</table>
	</form>
	<hr/>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/submodules/task.dialog.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

	<table width="100%" class="ui-widget" cellspacing="0" rules="all">
	    <thead class="ui-widget-header">
		<tr>
		    <th rowspan="2">#</th>
		    <th rowspan="2">Номер задачи</th>
		    <th rowspan="2">Клиент</th>
		    <th rowspan="2">Суть задачи</th>
		    <th colspan="2">Дата</th>
		</tr>
		<tr>
		    <th>постановки</th>
		    <th>начала выполнения</th>
		</tr>
	    </thead>
	    <tbody class="ui-widget-content">
	    <?php $_from = $this->_tpl_vars['tasks']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['tasks'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['tasks']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['task']):
        $this->_foreach['tasks']['iteration']++;
?>
		<tr <?php if (!(1 & $this->_foreach['tasks']['iteration'])): ?>bgcolor="#f0f0ff"<?php endif; ?> class="task-row ui-state-default <?php if ($this->_tpl_vars['task']['close'] == 1): ?>ui-state-disabled<?php elseif (((is_array($_tmp=$this->_tpl_vars['task']['task_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, '%s') : smarty_modifier_date_format($_tmp, '%s')) < ((is_array($_tmp=time())) ? $this->_run_mod_handler('date_format', true, $_tmp, '%s') : smarty_modifier_date_format($_tmp, '%s'))): ?>ui-state-error<?php endif; ?>">
		    <td align="right" style="padding-right: 1em;"><?php echo $this->_foreach['tasks']['iteration']; ?>
</td>
		    <td align="center"><a href="task.php?id=<?php echo $this->_tpl_vars['task']['id']; ?>
"><?php echo $this->_tpl_vars['task']['id']; ?>
</a></td>
		    <td><a href="customer-view.php?id=<?php echo $this->_tpl_vars['task']['customer_id']; ?>
"><?php echo ((is_array($_tmp=$this->_tpl_vars['task']['customer_name'])) ? $this->_run_mod_handler('sslash', true, $_tmp) : stripslashes($_tmp)); ?>
</a></td>
		    <td style="max-width: 200px;"><?php echo ((is_array($_tmp=$this->_tpl_vars['task']['note'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'quotes') : smarty_modifier_escape($_tmp, 'quotes')); ?>
</td>
		    <td align="center"><?php if ($this->_tpl_vars['task']['date_time'] > 0): ?><?php echo ((is_array($_tmp=$this->_tpl_vars['task']['date_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, '%d.%m.%Y, %H:%M') : smarty_modifier_date_format($_tmp, '%d.%m.%Y, %H:%M')); ?>
<?php else: ?>&mdash;<?php endif; ?></td>
		    <td align="center"><?php if ($this->_tpl_vars['task']['task_time'] > 0): ?><?php echo ((is_array($_tmp=$this->_tpl_vars['task']['task_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, '%d.%m.%Y, %H:%M') : smarty_modifier_date_format($_tmp, '%d.%m.%Y, %H:%M')); ?>
<?php else: ?>&mdash;<?php endif; ?></td>
		</tr>
	    <?php endforeach; else: ?>
		<tr><td align="center" colspan="6"><i>задач не найдено</i></td></tr>
	    <?php endif; unset($_from); ?>
	    </tbody>
	</table>
    </body>
</html>